#include<cstdio>
using namespace std;
int main(){
	freopen("candy.in","r",stdin);
	freopen("candy.out","w",stdout);
	int n,l,r,nn;
	scanf("%d%d%d",&n,&l,&r);
	nn=n;
	if(l%n!=0)n=n*(l/n);
	else n=l;
	if(n+nn<=r)printf("%d",nn-1);
	else printf("%d",r-n);
	fclose(stdin);
	fclose(stdout);
	return 0;
}
